﻿using System.Text.Json;
using System.Text.Json.Serialization;

var id = 1;
var item = new { id = id };
var dictionary = new Dictionary<string, object>();
dictionary.Add("id", id);

// 将item转换为JSON
string itemJson = JsonSerializer.Serialize(item);
Console.WriteLine($"Item JSON: {itemJson}");

// 将dictionary转换为JSON
string dictionaryJson = JsonSerializer.Serialize(dictionary);
Console.WriteLine($"Dictionary JSON: {dictionaryJson}");

Console.WriteLine(itemJson == dictionaryJson);
